Here, I want to investigate if a velocity based visualization is able to capture trajectories, even if intermediate populations are missing. To do this, I will use the pancreas development dataset from scVelo and remove cell types that are in the intermediate stages of the endocrine development trajectory.
Note: using weighted graphs vs unweighted graphs and more cells than in first graph_pancViz analysis.. so results are slightly different.

Setup and get data from scVelo

Use the reticulate package to use scVelo from within R:

Compute velocities on pancreas data using velocyto

Extract spliced and unspliced data

Extract PCA coordinates

Filter genes

Downsample cells to make things easier

Normalize for dimensional reduction

## Warning in if (!class(counts) %in% c("dgCMatrix", "dgTMatrix")) {: the condition
## has length > 1 and only the first element will be used
## Converting to sparse matrix ...
## Normalizing matrix with 1232 cells and 8636 genes

Dimensional reduction

Run velocyto on panc data

Graph visualization

Scores of observed and projected states in PC space

Graph visualization on subset of cells from PC coordinates

Removing cell types

First, we’ll see if removing Ngn3 low EP cell types affects the visualization. Given that there are only relatively few of these cells, I suspect that the effect won’t be noticeable in the visualization.

As expected, the visualization doesn’t change very much by removing Ngn3 low EP cells. Next, let’s see the effect of removing Ngn3 high EP or Pre-endocrine cells.
First, remove pre-endocrine cells..

## [1] "Done finding neighbors"
## [1] "Done making graph"

## delta projections ... sqrt knn ... transition probs ... done
## calculating arrows ... done
## grid estimates ... grid.sd= 0.09987699  min.arrow.size= 0.00199754  max.grid.arrow.length= 0.0610458  done

…and now Ngn3 high EP

## [1] "Done finding neighbors"
## [1] "Done making graph"

## delta projections ... sqrt knn ... transition probs ... done
## calculating arrows ... done
## grid estimates ... grid.sd= 0.1029661  min.arrow.size= 0.002059322  max.grid.arrow.length= 0.0610458  done

Let’s try removing multiple subsets, Ngn3 highEP and Pre-endocrine

## [1] "Done finding neighbors"
## [1] "Done making graph"

## delta projections ... sqrt knn ... transition probs ... done
## calculating arrows ... done
## grid estimates ... grid.sd= 0.09620078  min.arrow.size= 0.001924016  max.grid.arrow.length= 0.0610458  done